var mAutos = [];
var mInputs = [];
function loopSubmit() {
    var sendB = document.getElementById('qr_submit_id');
    if(sendB){
        if(sendB.className == 'btn92s'){
            console.log(sendB.className);
            if (mAutos.includes('zdqr')) {
                sendB.click();
            }
        }else{
            sendB.className = 'btn92s';
            setTimeout(loopSubmit, 500);
        }
    }else{
        setTimeout(loopSubmit, 30);
    }
}  
  
function sendButton() {
    if(Array.isArray(mInputs)){
        mInputs.forEach((item)=>{
            var label = document.getElementsByClassName('check')[item];
            label.click();
        })
    }else{
        var label = document.getElementsByClassName('check')[0];
        label.click();
    }
    var button = document.getElementById('submitOrder_id');
    if (mAutos.includes('zdtj')) {
        button.click();
    }

    loopSubmit();
}

function mIntLoad() {
    var mAut = localStorage.getItem('mAutos');
    var mInp = localStorage.getItem('mInputs');
    if(mAut){
        mAutos = JSON.parse(mAut);
    }else{
        mAutos = [];
    }
    if(mInp){
        mInputs = JSON.parse(mInp);
    }else{
        mInputs = [];
    }
}
window.onload = function() {
    mIntLoad();
    sendButton();
}